// Author  : Morbid
// Time    : 2022/04/30 19:35
// FileName: Main_58.java
// Software: IntelliJ IDEA

package LeetCode;

public class Main_58 {
    //58.最后一个数的长度
    static int lengthOfLastWord(String s) {
        String[] tem = s.trim().split(" ");
        return tem[tem.length - 1].length();
    }

    public static void main(String[] args) {
        String s = "   fly me   to   the moon  ";
        System.out.println(lengthOfLastWord(s));

    }

}
